package org.example.springblog.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.example.springblog.utils.DateUtils;

import java.util.Date;
@Data
public class BlogInfo {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    private Integer deleteFlag;
    private Date createTime;
    private Date updateTime;
    private Boolean isLoginUser;
    public BlogInfo() {
    }

    public BlogInfo(String title, String content, Integer userId) {
        this.title = title;
        this.content = content;
        this.userId = userId;
    }

    //这里应该在生成的时候，会调用这个函数
    public String getCreateTime() {
        System.out.println("11111111111111111111");
        return DateUtils.formatDate(createTime);
    }
}
